home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
kcl
/
akcl
/
kcl.lha
/
lsp
/
module.lsp
< prev
next >
Wrap
Lisp/Scheme
|
1987-06-04
|
2KB
|
67 lines
;; (c) Copyright Taiichi Yuasa and Masami Hagiya, 1984. All rights reserved.
;; Copying of this file is authorized to users who have executed the true and
;; proper "License Agreement for Kyoto Common LISP" with SIGLISP.
;;;; module.lsp
;;;;
;;;; module routines
(in-package 'lisp)
(export '(*modules* provide require))
(export 'documentation)
(export '(variable function structure type setf))
(in-package 'system)
(eval-when (compile) (proclaim '(optimize (safety 2) (space 3))))
(defvar *modules* nil)
(defun provide (module-name)
(setq *modules*
(adjoin (string module-name)
*modules*
:test #'string=)))
(defun require (module-name
&optional (pathname (string-downcase (string module-name))))
(let ((*default-pathname-defaults* #""))
(unless (member (string module-name)
*modules*
:test #'string=)
(if (atom pathname)
(load pathname)
(do ((p pathname (cdr p)))
((endp p))
(load (car p)))))))
(defun documentation (symbol doc-type)
(case doc-type
(variable (get symbol 'variable-documentation))
(function (get symbol 'function-documentation))
(structure (get symbol 'structure-documentation))
(type (get symbol 'type-documentation))
(setf (get symbol 'setf-documentation))
(t (error "~S is an illegal documentation type." doc-type))))
(defun find-documentation (body)
(if (or (endp body) (endp (cdr body)))
nil
(let ((form (macroexpand (car body))))
(if (stringp form)
form
(if (and (consp form)
(eq (car form) 'declare))
(find-documentation (cdr body))
nil)))))